﻿Imports System
Imports System.Workflow.ComponentModel.Design

Namespace System.Workflow.ComponentModel
    <ActivityDesignerTheme(GetType(CompensateDesignerTheme))> _
    Friend NotInheritable Class CompensateDesigner
        Inherits ActivityDesigner
        ' Methods
        Public Overrides Function CanBeParentedTo(ByVal parentActivityDesigner As CompositeActivityDesigner) As Boolean
            Dim activity As Activity = parentActivityDesigner.Activity
            Do While (Not activity Is Nothing)
                If ((TypeOf activity Is CancellationHandlerActivity OrElse TypeOf activity Is CompensationHandlerActivity) OrElse TypeOf activity Is FaultHandlerActivity) Then
                    Return True
                End If
                activity = activity.Parent
            Loop
            Return False
        End Function

    End Class
End Namespace

